<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh-cn" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="../common/common.jsp"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2-metronic.css"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/css/pages/timeline.css"/>
    <link href="${path}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
    <link href="${path}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
</head>
<body class="page-header-fixed">
<jsp:include page="../common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
<div class="page-sidebar-wrapper"><jsp:include page="../common/menu.jsp"/></div>
<div class="page-content-wrapper">
<div class="page-content">
<div class="row">
<div class="col-md-12">
<div class="portlet box purple">
<div class="portlet-title">
    <div class="caption">
        <i class="fa fa-globe"></i>消息列表
    </div>
    <div class="tools">
        <div class="actions">
            <a href="${path}/info/send" class="btn green"><i class="fa fa-plus"> 发送消息</i></a>
        </div>
    </div>
</div>
<div class="portlet-body">
    <form id="formQuery" class="form-horizontal" action="${path}/info/forinfo">
        <div class="form-body">
            <div class="form-group">
                <label class="col-md-1 control-label">消息类型</label>
                <div class="col-md-2">
                    <select id="type" name="type" class="form-control">
                        <option value="">所有</option>
                         <option value="1">系统消息</option>
                          <option value="4">会员消息</option>
                          <option value="2">管理员发送</option>
                    </select>
                </div>
                <label class="col-md-1 control-label">状态:</label>

                <div class="col-md-2">
                    <select id="flag" name="flag" class="form-control">
                        <option value="">所有</option>
                        <option value="1">已读</option>
                        <option value="0">未读</option>
                    </select>
                </div>
                <div class="col-md-1">
                    <button type="button" id="searchList" class="btn green">查询</button>
                </div>
            </div>

        </div>
    </form>
    <table class="table table-striped table-bordered table-hover" id="businessList"></table>
    <div id="panel" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"></button>
                    <h4 class="modal-title">发送消息</h4>
                </div>
                <div class="modal-body">
                    <form id="panelForm">
                    <div class="row">
                        <input type="hidden" id="userid" name="userid">
                        <input type="hidden" id="type" name="type" value="2">
	                    <label class="col-md-2" style="text-align: right;">标题：  </label>
	                    <p class="col-md-10"><input type="text" id="title" name="title" style="width: 400px;height: 27px"></p>
                    </div>
                    <div class="row">
	                    <label class="col-md-2" style="text-align: right;">内容：  </label>
	                     <p class="col-md-10">
	                          <textarea id="textarea" name="context" class="form-control" maxlength="225"
	                                      rows="3"></textarea>
	                        <p>
                    </div> 
                    </form>
                </div>
                <div class="modal-footer">
                   
                    <button type="button" class="btn default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn blue" id="btnPanel">提交</button>
                </div>
            </div>
        </div>
    </div>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="../common/footer.jsp"/>
<script type="text/javascript" src="${path}/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js"></script>
<script type="text/javascript" src="${path}/assets/scripts/custom/components-pickers.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="${path}/assets/scripts/biz/jsAddress.js"></script>
<script type="text/javascript" src="${path}/operate/js/info.js"></script>
<script type="text/javascript">
    var msgid;
    var msg = '${msg}';
    $(function () {
        if(msg) App.bubble(200, msg);
        $("#btnPanel").click(function () {
            App.ajax(_path + "/info/save", $("#panelForm").serialize(), function (data) {
                if (data && data.statusCode === 200) {
                    $('#panel').modal('hide');
                }
            });
        });
        
        $("#searchList").click(function () {
        	getMsgList();
        });
        
        getMsgList();
    });

</script>
</body>
<!-- END BODY -->
</html>